Skip to content

Add opt-in --crd flag to install and uninstall commands#470

Open
kelos-bot[bot] wants to merge 2 commits intomainfrom
kelos-task-461
Open

Add opt-in --crd flag to install and uninstall commands#470
kelos-bot[bot] wants to merge 2 commits intomainfrom
kelos-task-461

Conversation

@kelos-bot
Copy link

@kelos-bot kelos-bot bot commented Feb 27, 2026

Summary

  • Adds a --crd flag (default false) to the install command — CRDs are only installed when explicitly requested with --crd
  • Adds a --crd flag (default false) to the uninstall command — CRDs are only removed when explicitly requested with --crd
  • Dry-run mode respects the flag: install --dry-run --crd includes CRD manifests in output

Motivation

CRDs define custom resource types and deleting them cascades to all custom resources in the cluster. Making CRD install/uninstall opt-in (rather than the default) is a reasonable safety measure that gives users explicit control.

Test plan

  • Added TestInstallCommand_CRDFlagDefault — verifies default dry-run output excludes CRDs
  • Added TestInstallCommand_CRDFlagTrue — verifies --crd includes CRD manifests in dry-run output
  • Added TestUninstallCommand_CRDFlagAccepted — verifies the --crd flag is accepted by uninstall
  • Updated TestInstallCommand_DryRun — updated to match new default (no CRDs)
  • All existing tests continue to pass
  • make verify passes
  • make test passes

Closes #461

🤖 Generated with Claude Code

CRDs define custom resource types and deleting them cascades to all
custom resources in the cluster. Add a --crd flag (default true) to both
install and uninstall commands so users can explicitly control whether
CRDs are installed or removed.

When --crd=false is passed to install, CRD application is skipped.
When --crd=false is passed to uninstall, CRD deletion is skipped,
keeping custom resources intact.

Closes #461

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Copy link
Collaborator

@gjkim42 gjkim42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it better to just install crds if it's provided?

@gjkim42
Copy link
Collaborator

gjkim42 commented Feb 28, 2026

/reset-worker

CRDs should be treated carefully since deleting them cascades to all
custom resources in the cluster. Change --crd from default true to
default false so users must explicitly opt in with --crd to install
or remove CRDs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kelos-bot kelos-bot bot changed the title Add --crd flag to install and uninstall commands Add opt-in --crd flag to install and uninstall commands Feb 28, 2026
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/cli/install.go">

<violation number="1" location="internal/cli/install.go:96">
P0: The `--crd` flag default is changed from `true` to `false`, which is a breaking change that contradicts the PR description (which says default is `true`) and the README Quick Start guide (which says `kelos install` installs CRDs). Users running `kelos install` will silently skip CRD installation. If the intent is truly `default=false`, the README must be updated; if not, this default should be `true`.

(Based on your team's feedback about keeping documentation and config updated with changes.) [FEEDBACK_USED]</violation>

<violation number="2" location="internal/cli/install.go:183">
P2: The `--crd` flag default is changed from `true` to `false` for uninstall, contradicting the PR description which says default is `true`. While `default=false` is arguably the safer choice for uninstall (since deleting CRDs cascades to all custom resources), this contradicts the stated design. If `default=false` is intentional, the PR description needs correction; if not, restore `true`.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

cmd.Flags().BoolVar(&dryRun, "dry-run", false, "print the manifests that would be applied without installing")
cmd.Flags().StringVar(&flagVersion, "version", "", "override the version used for image tags (defaults to the binary version)")
cmd.Flags().StringVar(&imagePullPolicy, "image-pull-policy", "", "set imagePullPolicy on controller containers (e.g. Always, IfNotPresent, Never)")
cmd.Flags().BoolVar(&crd, "crd", false, "install CRDs along with the controller")
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0: The --crd flag default is changed from true to false, which is a breaking change that contradicts the PR description (which says default is true) and the README Quick Start guide (which says kelos install installs CRDs). Users running kelos install will silently skip CRD installation. If the intent is truly default=false, the README must be updated; if not, this default should be true.

(Based on your team's feedback about keeping documentation and config updated with changes.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At internal/cli/install.go, line 96:

<comment>The `--crd` flag default is changed from `true` to `false`, which is a breaking change that contradicts the PR description (which says default is `true`) and the README Quick Start guide (which says `kelos install` installs CRDs). Users running `kelos install` will silently skip CRD installation. If the intent is truly `default=false`, the README must be updated; if not, this default should be `true`.

(Based on your team's feedback about keeping documentation and config updated with changes.) </comment>

<file context>
@@ -95,7 +93,7 @@ func newInstallCommand(cfg *ClientConfig) *cobra.Command {
 	cmd.Flags().StringVar(&flagVersion, "version", "", "override the version used for image tags (defaults to the binary version)")
 	cmd.Flags().StringVar(&imagePullPolicy, "image-pull-policy", "", "set imagePullPolicy on controller containers (e.g. Always, IfNotPresent, Never)")
-	cmd.Flags().BoolVar(&crd, "crd", true, "install CRDs (set to false to skip CRD installation)")
+	cmd.Flags().BoolVar(&crd, "crd", false, "install CRDs along with the controller")
 
 	return cmd
</file context>
Suggested change
cmd.Flags().BoolVar(&crd, "crd", false, "install CRDs along with the controller")
cmd.Flags().BoolVar(&crd, "crd", true, "install CRDs (set to false to skip CRD installation)")
Fix with Cubic

},
}

cmd.Flags().BoolVar(&crd, "crd", false, "remove CRDs along with the controller")
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The --crd flag default is changed from true to false for uninstall, contradicting the PR description which says default is true. While default=false is arguably the safer choice for uninstall (since deleting CRDs cascades to all custom resources), this contradicts the stated design. If default=false is intentional, the PR description needs correction; if not, restore true.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At internal/cli/install.go, line 183:

<comment>The `--crd` flag default is changed from `true` to `false` for uninstall, contradicting the PR description which says default is `true`. While `default=false` is arguably the safer choice for uninstall (since deleting CRDs cascades to all custom resources), this contradicts the stated design. If `default=false` is intentional, the PR description needs correction; if not, restore `true`.</comment>

<file context>
@@ -175,16 +173,14 @@ func newUninstallCommand(cfg *ClientConfig) *cobra.Command {
 	}
 
-	cmd.Flags().BoolVar(&crd, "crd", true, "remove CRDs (set to false to keep CRDs in the cluster)")
+	cmd.Flags().BoolVar(&crd, "crd", false, "remove CRDs along with the controller")
 
 	return cmd
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add --crd to install and uninstall command

1 participant